Optimal. Leaf size=145 \[ 2 a b e^x \sqrt {c+d x}+\frac {1}{2} b^2 e^{2 x} \sqrt {c+d x}+\frac {2 a^2 (c+d x)^{3/2}}{3 d}-a b \sqrt {d} e^{-\frac {c}{d}} \sqrt {\pi } \text {erfi}\left (\frac {\sqrt {c+d x}}{\sqrt {d}}\right )-\frac {1}{4} b^2 \sqrt {d} e^{-\frac {2 c}{d}} \sqrt {\frac {\pi }{2}} \text {erfi}\left (\frac {\sqrt {2} \sqrt {c+d x}}{\sqrt {d}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.14, antiderivative size = 145, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {2214, 2207,
2211, 2235} \begin {gather*} \frac {2 a^2 (c+d x)^{3/2}}{3 d}-\sqrt {\pi } a b \sqrt {d} e^{-\frac {c}{d}} \text {Erfi}\left (\frac {\sqrt {c+d x}}{\sqrt {d}}\right )+2 a b e^x \sqrt {c+d x}-\frac {1}{4} \sqrt {\frac {\pi }{2}} b^2 \sqrt {d} e^{-\frac {2 c}{d}} \text {Erfi}\left (\frac {\sqrt {2} \sqrt {c+d x}}{\sqrt {d}}\right )+\frac {1}{2} b^2 e^{2 x} \sqrt {c+d x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2207
Rule 2211
Rule 2214
Rule 2235
Rubi steps
\begin {align*} \int \left (a+b e^x\right )^2 \sqrt {c+d x} \, dx &=\int \left (a^2 \sqrt {c+d x}+2 a b e^x \sqrt {c+d x}+b^2 e^{2 x} \sqrt {c+d x}\right ) \, dx\\ &=\frac {2 a^2 (c+d x)^{3/2}}{3 d}+(2 a b) \int e^x \sqrt {c+d x} \, dx+b^2 \int e^{2 x} \sqrt {c+d x} \, dx\\ &=2 a b e^x \sqrt {c+d x}+\frac {1}{2} b^2 e^{2 x} \sqrt {c+d x}+\frac {2 a^2 (c+d x)^{3/2}}{3 d}-(a b d) \int \frac {e^x}{\sqrt {c+d x}} \, dx-\frac {1}{4} \left (b^2 d\right ) \int \frac {e^{2 x}}{\sqrt {c+d x}} \, dx\\ &=2 a b e^x \sqrt {c+d x}+\frac {1}{2} b^2 e^{2 x} \sqrt {c+d x}+\frac {2 a^2 (c+d x)^{3/2}}{3 d}-(2 a b) \text {Subst}\left (\int e^{-\frac {c}{d}+\frac {x^2}{d}} \, dx,x,\sqrt {c+d x}\right )-\frac {1}{2} b^2 \text {Subst}\left (\int e^{-\frac {2 c}{d}+\frac {2 x^2}{d}} \, dx,x,\sqrt {c+d x}\right )\\ &=2 a b e^x \sqrt {c+d x}+\frac {1}{2} b^2 e^{2 x} \sqrt {c+d x}+\frac {2 a^2 (c+d x)^{3/2}}{3 d}-a b \sqrt {d} e^{-\frac {c}{d}} \sqrt {\pi } \text {erfi}\left (\frac {\sqrt {c+d x}}{\sqrt {d}}\right )-\frac {1}{4} b^2 \sqrt {d} e^{-\frac {2 c}{d}} \sqrt {\frac {\pi }{2}} \text {erfi}\left (\frac {\sqrt {2} \sqrt {c+d x}}{\sqrt {d}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.99, size = 181, normalized size = 1.25 \begin {gather*} \frac {\sqrt {c+d x} \left (6 b^2 e^{2 x} \sqrt {-\frac {c+d x}{d}}-8 a^2 \left (-\frac {c+d x}{d}\right )^{3/2}+12 a b e^{-\frac {c}{d}} \left (\sqrt {\pi }+2 e^{\frac {c}{d}+x} \sqrt {-\frac {c+d x}{d}}-\sqrt {\pi } \text {erf}\left (\sqrt {-\frac {c+d x}{d}}\right )\right )-3 b^2 e^{-\frac {2 c}{d}} \sqrt {\frac {\pi }{2}} \left (-1+\text {erf}\left (\sqrt {2} \sqrt {-\frac {c+d x}{d}}\right )\right )\right )}{12 \sqrt {-\frac {c+d x}{d}}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.05, size = 144, normalized size = 0.99
method | result | size |
derivativedivides | \(\frac {\frac {2 \left (d x +c \right )^{\frac {3}{2}} a^{2}}{3}+2 b^{2} {\mathrm e}^{-\frac {2 c}{d}} \left (\frac {d \sqrt {d x +c}\, {\mathrm e}^{\frac {2 d x +2 c}{d}}}{4}-\frac {d \sqrt {\pi }\, \erf \left (\sqrt {-\frac {2}{d}}\, \sqrt {d x +c}\right )}{8 \sqrt {-\frac {2}{d}}}\right )+4 a b \,{\mathrm e}^{-\frac {c}{d}} \left (\frac {\sqrt {d x +c}\, {\mathrm e}^{\frac {d x +c}{d}} d}{2}-\frac {d \sqrt {\pi }\, \erf \left (\sqrt {-\frac {1}{d}}\, \sqrt {d x +c}\right )}{4 \sqrt {-\frac {1}{d}}}\right )}{d}\) | \(144\) |
default | \(\frac {\frac {2 \left (d x +c \right )^{\frac {3}{2}} a^{2}}{3}+2 b^{2} {\mathrm e}^{-\frac {2 c}{d}} \left (\frac {d \sqrt {d x +c}\, {\mathrm e}^{\frac {2 d x +2 c}{d}}}{4}-\frac {d \sqrt {\pi }\, \erf \left (\sqrt {-\frac {2}{d}}\, \sqrt {d x +c}\right )}{8 \sqrt {-\frac {2}{d}}}\right )+4 a b \,{\mathrm e}^{-\frac {c}{d}} \left (\frac {\sqrt {d x +c}\, {\mathrm e}^{\frac {d x +c}{d}} d}{2}-\frac {d \sqrt {\pi }\, \erf \left (\sqrt {-\frac {1}{d}}\, \sqrt {d x +c}\right )}{4 \sqrt {-\frac {1}{d}}}\right )}{d}\) | \(144\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.55, size = 160, normalized size = 1.10 \begin {gather*} \frac {16 \, {\left (d x + c\right )}^{\frac {3}{2}} a^{2} - 24 \, {\left (\frac {\sqrt {\pi } d \operatorname {erf}\left (\sqrt {d x + c} \sqrt {-\frac {1}{d}}\right ) e^{\left (-\frac {c}{d}\right )}}{\sqrt {-\frac {1}{d}}} - 2 \, \sqrt {d x + c} d e^{\left (\frac {d x + c}{d} - \frac {c}{d}\right )}\right )} a b - 3 \, {\left (\frac {\sqrt {2} \sqrt {\pi } d \operatorname {erf}\left (\sqrt {2} \sqrt {d x + c} \sqrt {-\frac {1}{d}}\right ) e^{\left (-\frac {2 \, c}{d}\right )}}{\sqrt {-\frac {1}{d}}} - 4 \, \sqrt {d x + c} d e^{\left (\frac {2 \, {\left (d x + c\right )}}{d} - \frac {2 \, c}{d}\right )}\right )} b^{2}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.42, size = 133, normalized size = 0.92 \begin {gather*} \frac {3 \, \sqrt {2} \sqrt {\pi } b^{2} d^{2} \sqrt {-\frac {1}{d}} \operatorname {erf}\left (\sqrt {2} \sqrt {d x + c} \sqrt {-\frac {1}{d}}\right ) e^{\left (-\frac {2 \, c}{d}\right )} + 24 \, \sqrt {\pi } a b d^{2} \sqrt {-\frac {1}{d}} \operatorname {erf}\left (\sqrt {d x + c} \sqrt {-\frac {1}{d}}\right ) e^{\left (-\frac {c}{d}\right )} + 4 \, {\left (4 \, a^{2} d x + 3 \, b^{2} d e^{\left (2 \, x\right )} + 12 \, a b d e^{x} + 4 \, a^{2} c\right )} \sqrt {d x + c}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 1.58, size = 184, normalized size = 1.27 \begin {gather*} \frac {2 a^{2} \left (c + d x\right )^{\frac {3}{2}}}{3 d} - \sqrt {\pi } a b \sqrt {d} e^{- \frac {c}{d}} \operatorname {erfi}{\left (\frac {\sqrt {c + d x}}{d \sqrt {\frac {1}{d}}} \right )} + \frac {2 a b \sqrt {c + d x} e^{- \frac {c}{d}} e^{\frac {c}{d} + x}}{\sqrt {d} \sqrt {\frac {1}{d}}} - \frac {\sqrt {2} \sqrt {\pi } b^{2} \sqrt {d} e^{- \frac {2 c}{d}} \operatorname {erfi}{\left (\frac {\sqrt {2} \sqrt {c + d x}}{d \sqrt {\frac {1}{d}}} \right )}}{8} + \frac {b^{2} \sqrt {c + d x} e^{- \frac {2 c}{d}} e^{\frac {2 c}{d} + 2 x}}{2 \sqrt {d} \sqrt {\frac {1}{d}}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 250 vs.
\(2 (110) = 220\).
time = 1.87, size = 250, normalized size = 1.72 \begin {gather*} -\frac {\frac {12 \, \sqrt {2} \sqrt {\pi } b^{2} c d \operatorname {erf}\left (-\frac {\sqrt {2} \sqrt {d x + c} \sqrt {-d}}{d}\right ) e^{\left (-\frac {2 \, c}{d}\right )}}{\sqrt {-d}} + \frac {48 \, \sqrt {\pi } a b c d \operatorname {erf}\left (-\frac {\sqrt {d x + c} \sqrt {-d}}{d}\right ) e^{\left (-\frac {c}{d}\right )}}{\sqrt {-d}} - 48 \, \sqrt {d x + c} a^{2} c - 16 \, {\left ({\left (d x + c\right )}^{\frac {3}{2}} - 3 \, \sqrt {d x + c} c\right )} a^{2} - 24 \, {\left (\frac {\sqrt {\pi } {\left (2 \, c + d\right )} d \operatorname {erf}\left (-\frac {\sqrt {d x + c} \sqrt {-d}}{d}\right ) e^{\left (-\frac {c}{d}\right )}}{\sqrt {-d}} + 2 \, \sqrt {d x + c} d e^{x}\right )} a b - 3 \, {\left (\frac {\sqrt {2} \sqrt {\pi } {\left (4 \, c + d\right )} d \operatorname {erf}\left (-\frac {\sqrt {2} \sqrt {d x + c} \sqrt {-d}}{d}\right ) e^{\left (-\frac {2 \, c}{d}\right )}}{\sqrt {-d}} + 4 \, \sqrt {d x + c} d e^{\left (2 \, x\right )}\right )} b^{2}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (a+b\,{\mathrm {e}}^x\right )}^2\,\sqrt {c+d\,x} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________